// pages/login/index.js
Page({
  data: {
    checked: false,
    showTooltip: false,
    phone: '',
    verif: ''
  },

  handleInput(e) {
    const value = e.detail.value;
    const key = e.target.dataset.key;
    this.setData({
      [key]: value
    })
  },
  handleLogin() {
    if (!this.data.checked) {
      wx.showToast({
        title: '请先同意用户协议',
        icon: 'none'
      })
    }
    console.log(this.data.phone, this.data.verif);
  },
  handleRadio() {
    this.setData({
      checked: !this.data.checked
    })
  },
  handlePrivate(e) {
    const {
      value
    } = e.target.dataset;
    let urlMap = {
      user: 'pages/index/index',
      private: 'pages/index/index'
    }
    wx.navigateTo({url: urlMap[value]})
  },
  handlePop() {
    this.setData({
      showTooltip: false
    })
  }
})